import React, {Component} from 'react';
import { withRouter } from "react-router-dom";
import { NavBar, Icon } from "antd-mobile";
// import style from './NavBarMy.module.scss';

class NavBarMy extends Component {
    render() {
        return (
            <div >
                <NavBar
                    style={{background:'#ea4350',color:'white'}}
                    mode="light"
                    icon={this.props.left?<Icon type="left" />:''}
                    onLeftClick={() => this.props.history.go(-1)}
                >
                    <div style={{color:'white'}}>{this.props.title}</div>
                </NavBar>
            </div>
        );
    }
}

export default withRouter(NavBarMy);
